// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'BomId',
        footer: "Foots",
        cnName: '生产BOM',
        name: 'MaterialsBom',
        newTabEdit: false,
        url: "/MaterialsBom/",
        sortName: "BomId"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"BillNo":"","MaterialNo":"","MaterialName":"","Spec":"","MaterialTypeId":"","DepartmentId":[],"IsEnabled":"","Remark":"","BomVersion":""};
    const editFormOptions = [[{"title":"Bom编码","field":"BillNo","disabled":true,"type":"text"},
                               {"title":"产品编码","required":true,"field":"MaterialNo","disabled":true,"type":"text"},
                               {"title":"产品名称","required":true,"field":"MaterialName","disabled":true,"type":"text"}],
                              [{"title":"产品规格","field":"Spec","disabled":true,"type":"text"},
                               {"dataKey":"物料属性","data":[],"title":"产品类型","field":"MaterialTypeId","disabled":true,"type":"select"},
                               {"dataKey":"部门级联","data":[],"title":"部门","field":"DepartmentId","type":"cascader"}],
                              [{"dataKey":"是否","data":[],"title":"使用状态","field":"IsEnabled","type":"select"},
                               {"title":"备注","field":"Remark","type":"text"},
                               {"title":"Bom版本","required":true,"field":"BomVersion","type":"text"}]];
    const searchFormFields = {"BillNo":"","MaterialNo":"","MaterialName":"","IsEnabled":""};
    const searchFormOptions = [[{"title":"Bom编码","field":"BillNo","type":"like"},{"title":"产品编码","field":"MaterialNo","type":"like"},{"title":"产品名称","field":"MaterialName","type":"like"},{"dataKey":"是否","data":[],"title":"使用状态","field":"IsEnabled","type":"radio"}]];
    const columns = [{field:'BomId',title:'Bom标识',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'BillNo',title:'Bom编码',type:'string',width:110,readonly:true,align:'left'},
                       {field:'MaterialId',title:'产品标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'MaterialNo',title:'产品编码',type:'string',width:110,readonly:true,require:true,align:'left'},
                       {field:'MaterialName',title:'产品名称',type:'string',width:110,readonly:true,require:true,align:'left'},
                       {field:'Spec',title:'产品规格',type:'string',width:110,readonly:true,align:'left'},
                       {field:'MaterialTypeId',title:'产品类型',type:'int',bind:{ key:'物料属性',data:[]},width:110,readonly:true,align:'left'},
                       {field:'DepartmentId',title:'部门',type:'guid',bind:{ key:'部门级联',data:[]},width:110,align:'left'},
                       {field:'DepartmentName',title:'部门名称',type:'string',bind:{ key:'部门',data:[]},width:110,hidden:true,align:'left'},
                       {field:'IsEnabled',title:'使用状态',type:'int',bind:{ key:'是否',data:[]},width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:150,align:'left'},
                       {field:'BomVersion',title:'Bom版本',type:'string',width:110,require:true,align:'left'},
                       {field:'CreateID',title:'创建人标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人名称',type:'string',width:100,align:'left'},
                       {field:'CreateDate',title:'创建日期',type:'datetime',width:110,align:'left'},
                       {field:'ModifyID',title:'修改人标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人名称',type:'string',width:100,align:'left'},
                       {field:'ModifyDate',title:'修改日期',type:'datetime',width:110,align:'left'},
                       {field:'AuditDate',title:'审核日期',type:'datetime',width:110,align:'left'},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'AuditId',title:'审核人标识',type:'int',width:110,align:'left'},
                       {field:'Auditor',title:'审核人',type:'string',width:120,align:'left'}];
    const detail =  {
                    cnName: 'Bom清单明细',
                    table: 'MaterialBomDetail',
                    columns: [{field:'BomDetailId',title:'Bom明细标识',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'BomId',title:'Bom标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'NextBomId',title:'子件Bom标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'MaterialId',title:'子产品标识',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'MaterialNo',title:'子产品编码',type:'string',width:110,edit:{type:'selectTable'},require:true,align:'left'},
                       {field:'MaterialName',title:'产品名称',type:'string',width:110,readonly:true,edit:{type:'text'},require:true,align:'left'},
                       {field:'Spec',title:'规格',type:'string',width:110,readonly:true,edit:{type:'text'},align:'left'},
                       {field:'MaterialTypeId',title:'产品类型',type:'int',bind:{ key:'物料属性',data:[]},width:80,edit:{type:'select'},require:true,align:'left'},
                       {field:'Position',title:'位置',type:'string',width:110,edit:{type:'text'},align:'left'},
                       {field:'UnitId',title:'计量单位',type:'int',bind:{ key:'计量单位',data:[]},width:80,edit:{type:'select'},require:true,align:'left'},
                       {field:'DepartmentId',title:'部门',type:'guid',bind:{ key:'部门级联',data:[]},width:110,edit:{type:'cascader'},align:'left'},
                       {field:'DepartmentName',title:'部门名称',type:'string',width:110,hidden:true,align:'left'},
                       {field:'IsBackflush',title:'是否倒冲',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'IsLot',title:'启用批次',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'UnitQty',title:'单位用量',type:'decimal',width:110,edit:{type:'decimal'},require:true,align:'left'},
                       {field:'IsCriticalParts',title:'是关键件',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'IsSpecialParts',title:'特殊关键件',type:'int',bind:{ key:'是否',data:[]},width:110,edit:{type:'select'},require:true,align:'left'},
                       {field:'AttritionRate',title:'损耗率',type:'decimal',width:110,edit:{type:'decimal'},require:true,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:110,edit:{type:'text'},align:'left'},
                       {field:'NextBomNo',title:'子件Bom编码',type:'string',width:120,edit:{type:'selectTable'},align:'left'}],
                    sortName: 'BomDetailId',
                    key: 'BomDetailId'
                                            };
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}